<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //条件判断if
    let xhs = 5, xg = 1;
    if(xg>0){
        xhs = 1;
    }
    console.log(xhs);
    /*
    if(条件表达式){
         条件为真
     }else{
        条件不为真
    }
    */
    //取两个值中的最大值
    let jj = 29, qq = 10;
    if(qq>9){
        jj = 11;
    }else{
        qq = 29;
    }
    console.log('最大值是：'+jj);
    console.log('-------------');
    let hh = prompt();
    let xx = prompt();
    let nun1;
    if(hh>xx){
        nun1 = xx;
    }else if(hh<xx){
        nun1 = hh;
    }else{
        console.log('a和b相等');
    }
    console.log('最大值是：'+nun1);
    
</script>
</html>